#!/usr/bin/env bash

function t {
    test_prog_ext agda agda
}

function test_prog_ext {
    prog="$1"
    ext="$2"

    for file in $(find src | grep "\.${ext}$")
    do
        echo ""
        echo "[test] $file"
        if ! time "$prog" "$file"
        then
            exit 1
        fi
    done
}

function main {
    for TASK in "$@"
    do
        "$TASK"
    done
    exit
}

main "$@"
